Add a reftest for box layouts
authorMatthias Clasen <mclasen@redhat.com>
Mon, 24 Aug 2020 14:58:18 +0000 (10:58 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 24 Aug 2020 15:34:30 +0000 (11:34 -0400)
This tests that invisible children don't influence
the layout.

testsuite/reftests/boxlayout-invisible-child.ref.ui [new file with mode: 0644]
testsuite/reftests/boxlayout-invisible-child.ui [new file with mode: 0644]
testsuite/reftests/meson.build

diff --git a/testsuite/reftests/boxlayout-invisible-child.ref.ui b/testsuite/reftests/boxlayout-invisible-child.ref.ui
new file mode 100644 (file)
index 0000000..04eb01f
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow" id="window_information_collection">
+    <property name="decorated">0</property>
+    <child>
+      <object class="GtkBox" id="box1">
+        <child>
+          <object class="GtkLabel" id="label1">
+            <property name="label" translatable="yes">Hello</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label3">
+            <property name="label" translatable="yes">World</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/reftests/boxlayout-invisible-child.ui b/testsuite/reftests/boxlayout-invisible-child.ui
new file mode 100644 (file)
index 0000000..d3f37c0
--- /dev/null
@@ -0,0 +1,27 @@
+<!-- check that an invisible child does not influence the layout -->
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow" id="window_information_collection">
+    <property name="decorated">0</property>
+    <child>
+      <object class="GtkBox" id="box1">
+        <child>
+          <object class="GtkLabel" id="label1">
+            <property name="label" translatable="yes">Hello</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label2">
+            <property name="visible">0</property>
+            <property name="label" translatable="yes">cruel</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label3">
+            <property name="label" translatable="yes">World</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
index 816e370992d23ba63d415cddd5b805e4355ef773..001baa6fb632ab5781066c6b63ab2576fcdb39c4 100644 (file)
@@ -141,6 +141,8 @@ testdata = [
   'border-style.css',
   'border-style.ref.ui',
   'border-style.ui',
+  'boxlayout-invisible-child.ref.ui',
+  'boxlayout-invisible-child.ui',
   'box-order.css',
   'box-order.ref.ui',
   'box-order.ui',